﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ProfessionalKnowledgeTrainingSchoolBL
	{

		#region ***** Init Methods ***** 
		ProfessionalKnowledgeTrainingSchoolDA objProfessionalKnowledgeTrainingSchoolDA;
		public ProfessionalKnowledgeTrainingSchoolBL()
		{
			objProfessionalKnowledgeTrainingSchoolDA = new ProfessionalKnowledgeTrainingSchoolDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ProfessionalKnowledgeTrainingSchool by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ProfessionalKnowledgeTrainingSchool</returns>
		public ProfessionalKnowledgeTrainingSchool GetByID(int id)
		{
			return objProfessionalKnowledgeTrainingSchoolDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ProfessionalKnowledgeTrainingSchool
		/// </summary>
		/// <returns>List<<ProfessionalKnowledgeTrainingSchool>></returns>
		public List<ProfessionalKnowledgeTrainingSchool> GetList()
		{
			string cacheName = "lstProfessionalKnowledgeTrainingSchool";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeTrainingSchoolDA.GetList(), "ProfessionalKnowledgeTrainingSchool");
			}
			return (List<ProfessionalKnowledgeTrainingSchool>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeTrainingSchool
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsProfessionalKnowledgeTrainingSchool";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeTrainingSchoolDA.GetDataSet(), "ProfessionalKnowledgeTrainingSchool");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ProfessionalKnowledgeTrainingSchool paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ProfessionalKnowledgeTrainingSchool>></returns>
		public List<ProfessionalKnowledgeTrainingSchool> GetListPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeTrainingSchoolDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeTrainingSchool paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeTrainingSchoolDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ProfessionalKnowledgeTrainingSchool within ProfessionalKnowledgeTrainingSchool database table
		/// </summary>
		/// <param name="obj_professionalknowledgetrainingschool">ProfessionalKnowledgeTrainingSchool</param>
		/// <returns>key of table</returns>
		public int Add(ProfessionalKnowledgeTrainingSchool obj_professionalknowledgetrainingschool)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingSchool", true);
			return objProfessionalKnowledgeTrainingSchoolDA.Add(obj_professionalknowledgetrainingschool);
		}

		/// <summary>
		/// updates the specified ProfessionalKnowledgeTrainingSchool
		/// </summary>
		/// <param name="obj_professionalknowledgetrainingschool">ProfessionalKnowledgeTrainingSchool</param>
		/// <returns></returns>
		public void Update(ProfessionalKnowledgeTrainingSchool obj_professionalknowledgetrainingschool)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingSchool", true);
			objProfessionalKnowledgeTrainingSchoolDA.Update(obj_professionalknowledgetrainingschool);
		}

		/// <summary>
		/// Delete the specified ProfessionalKnowledgeTrainingSchool
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingSchool", true);
			objProfessionalKnowledgeTrainingSchoolDA.Delete(id);
		}
		#endregion
	}
}
